/*
 * Copyright (c) ShaoxiongDu <Shaoxiong.dev@aliyun.com> 2021 all Rights Reserved
 */

package zh.codegym.task.task07.task0714;

import java.util.ArrayList;
import java.util.Scanner;

/* 
以相反顺序显示词语
*/

public class Solution {
    public static void main(String[] args) throws Exception {
        //在此编写你的代码
        Scanner scanner = new Scanner(System.in);
        ArrayList<String> strings = new ArrayList<String>();
        for (int i = 0; i < 5; i++) {
            strings.add(scanner.next());
        }
        strings.remove(2);
        for (int i = 3; i >= 0; i--) {
            System.out.println(strings.get(i));
        }
    }
}


